<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="/WEB-INF/tld/app.tld" %>
<%@ taglib prefix="ct" uri="/WEB-INF/tld/commonTag.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/jsp/common/common_header.jsp" %>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>


<script language="javascript">
    

	function funcDetail(store_code) {
		width = 830;
		height = 730;
	    x = (screen.width) ? (screen.width-width)/2 : 0;
	    y = (screen.height) ? (screen.height-height)/2 : 0;
	    var popUrl = 'popCreditStoreDetailInfo.do?store_code='+store_code;
		window.open(popUrl,'popCreditStoreDetailInfo', 'left=' + x + ',top=' + y + ',width=' + width + ',height=' + height + ',scrollbars=no,status=no,menubar=no');
	}

    // 검색 버튼 클릭
    function funcSearch() {
        if(checkSpecialRemove(document.form.searchValue.value) == false){
            return false;
        }   

        var searchStRegDt = document.getElementById('searchStRegDt').value.replace(/-/gi,"");
        var searchEdRegDt = document.getElementById('searchEdRegDt').value.replace(/-/gi,"");

        if(searchStRegDt > searchEdRegDt){ 
            alert("시작일이 종료일보다 큽니다.");
            return false;
        }
        
        var fm  = document.form;
        $("#page").val(1);
        fm.action = 'stayList.do';
        fm.submit();
    }
    
    // 엑셀다운
    function funcExcel(excelType){
        $("#excelType").val(excelType);
        document.form.action = 'findShoppingSpcExcel.omp';
        document.form.submit(); 
    }
    
    //////////////////////////////////
    //jQuery datepicker Form set
    ///////////////////////////////// 
    $(function() {
        $("#searchStRegDt").koreadate();
        $("#searchEdRegDt").koreadate();
    });    

        
    </script>
</head>
<body>
<div class="con_area">
<form id="form" name="form" action="" >
<input type="hidden" id="page" name="page" value="${model.page}"/>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
        <td align="left"><h2 class="tit">보류리스트</h2></td>
        <td align="right"><span>리스크 관리 > <b>보류리스트  </b></span></td>
    </tr>
</table>
    <div style="margin-top:7px"/>
        <table cellpadding="0" cellspacing="0" border="0" class="data_table_01">
            <tr>
                <td class="data_01" style='width:100px; text-align:left;'>&nbsp;검색일</td>
                <td class="data_02" colspan="3">
                    <input type='text' id="searchStRegDt" name="searchStRegDt" value="${model.searchStRegDt}" title="YYYY-MM-DD" style="width: 100px;" maxlength="10" readonly/>
                    ~
                    <input type='text' id="searchEdRegDt" name="searchEdRegDt" value="${model.searchEdRegDt}" title="YYYY-MM-DD" style="width: 100px;" maxlength="10" readonly/>
                     &nbsp;
                    <input type="button" class="button_80" value="최근 1주일" onclick="setOrderSearchDateAdminPoC('7day',form.searchStRegDt, form.searchEdRegDt);" />
                    <input type="button" class="button_80" value="최근 1개월" onclick="setOrderSearchDateAdminPoC('1month',form.searchStRegDt, form.searchEdRegDt);" />
                    <input type="button" class="button_80" value="최근 3개월" onclick="setOrderSearchDateAdminPoC('3month',form.searchStRegDt, form.searchEdRegDt);" />
                </td>
            </tr>        
            <tr>
                <td class="data_01" style='width:100px; text-align:left;'>&nbsp;검색조건</td>
                <td class="data_02">
                    <select id="searchType" name='searchValueType'>
                        <option value='' <c:out value="${empty model.searchValueType ? 'selected':''}"/>>전체</option>
                        <option value='01' <c:out value="${model.searchValueType eq '01' ? 'selected':''}"/>>가맹점 명</option>
                        <option value='02' <c:out value="${model.searchValueType eq '02' ? 'selected':''}"/>>사업자 번호</option>
                        <option value='03' <c:out value="${model.searchValueType eq '03' ? 'selected':''}"/>>대표자명</option>
                    </select>
                    <input type="text" id="searchValue" name="searchValue" value="${model.searchValue}" maxlength="50" size="20" onkeydown="if(event.keyCode=='13')funcSearch();"/>
                <td class="data_01" style='width:100px; text-align:left;'>&nbsp;카드사</td>
                <td class="data_02">
                    <select id="searchType_1" name='searchValueType_1'>
                        	<option value='' <c:out value="${empty model.searchValueType_1 ? 'selected':''}"/>>전체카드사</option>                    
		                    <c:if test='${not empty commonCodeList}'>
		                    	<c:forEach var="code" items="${commonCodeList}">
		                        	<option value=${code.dtl_cd} <c:out value="${model.searchValueType_1 eq code.dtl_cd ? 'selected':''}"/>>${code.cd_nm}</option>
		                        </c:forEach>
		                    </c:if>
                    </select>                    
                </td>
            </tr>
        </table>
			<p align="center">
	 				<input type='button' class='button_63_01' value='검색' onclick='funcSearch();'>
        	</p>
        	<br>        
    <table cellpadding="0" cellspacing="1" border="0" class="data_table_02" style="width:100%;" >
    <colgroup>
        <col width="5%" />
        <col width="20%" />
        <col width="5%" />
        <col width="10%" />
        <col width="25%" />
        <col width="25%" />
        <col width="10%" />
    </colgroup>
    <thead>
        <tr>
            <th>번호</th>
            <th>가맹점 명</th>
            <th>승인날짜</th>
            <th>카드번호</th>
            <th>매입사</th>
            <th>승인번호</th>
            <th>승인금액</th>
        </tr>
    </thead>
    <tbody>
<c:if test='${empty creditMinusLoanList}'>    
    <tr>
        <td colspan="7">
            <span style="padding-top:3px;*padding-top:2px;"><strong>조회된 데이터가 존재하지 않습니다.</strong></span>
        </td>
    </tr>
</c:if>
<c:if test='${not empty creditMinusLoanList}'>
	<c:forEach var="vo" items="${creditMinusLoanList}">
	    <tr onMouseOver="this.style.background='#FFF9E1'" onMouseOut="this.style.background='#FFFFFF'">
	        <td style="text-align:center;">${vo.num}</td>
	        <td style="text-align:center;">${vo.store_code}</td>
	        <td style="text-align:center;"></td>
	        <td style="text-align:center;">익일10시</td>	        
	        <td style="text-align:center;">24시</td>
	        <td style="text-align:center;"><font color="red">출금중</font></td>
	        <td style="text-align:center;">
	            <input type="button" class="button_28_02" value="대출내역" style="width:65px;" onclick="funcCpnCreate(this,'${prodId}','${seqNo}','${stat.index}')" <c:out value="${empty cpnId ? '':'disabled'}"/> />
	        </td>
	    </tr>
    </c:forEach>
</c:if>
    </tbody>
    </table>
    <br>

    
    <div class="paging_area">
        <ul class="paging_lay">
            <li class="paging_01">
                <ct:paging 
                    requestUrl="stayList.do?searchStRegDt=${model.searchStRegDt}&searchEdRegDt=${model.searchEdRegDt}&searchValueType=${model.searchValueType}&searchValue=${model.searchValue}" 
                    page="${model.page}" 
                    scale="${model.scale}" 
                    blockScale="10" 
                    total="${model.totalCount}"
                    paramPrefix="model" />
            </li>
        </ul>
    </div>

</form>
</div>
</body>

